#pragma once

#define LIST(...) {__VA_ARGS__}

// TEST_DATA(signalShape,
//           windowShape,
//           outputShape,
//           frameSize,
//           frameStep,
//           transposedFrames,
//           signalData,
//           windowData,
//           expectedOutput,
//           testcaseName)

// NOTE: expected output were generated using pyTorch.searchsorted implementation.

TEST_DATA(LIST(48),
          LIST(16),
          LIST(9, 3, 2),
          16,
          16,
          true,
          LIST(0.421005,
               0.023465,
               -0.394774,
               0.974785,
               0.512418,
               0.219203,
               -0.338684,
               1.122448,
               -0.128486,
               -0.484502,
               0.56865,
               1.332561,
               0.222876,
               0.093504,
               0.89355,
               -0.659941,
               1.187668,
               -2.086986,
               -0.42915,
               -0.198203,
               1.385841,
               0.052231,
               0.587976,
               -0.684267,
               -0.045731,
               0.629634,
               1.78197,
               -1.381788,
               0.812565,
               0.522027,
               0.013688,
               -0.070836,
               1.131118,
               0.147256,
               -0.452005,
               0.263287,
               0.489187,
               -0.710666,
               0.531863,
               -0.996062,
               0.188195,
               -0.022838,
               -0.961315,
               0.174546,
               -2.681746,
               -0.311997,
               -0.007598,
               0.152766),
          LIST(0.0,
               0.03806,
               0.146447,
               0.308658,
               0.5,
               0.691342,
               0.853553,
               0.96194,
               1.0,
               0.96194,
               0.853553,
               0.691342,
               0.5,
               0.308658,
               0.146446,
               0.03806),
          LIST(2.500471,
               0.0,
               2.061596,
               0.0,
               -2.69633,
               0.0,
               -0.832353,
               0.394573,
               -1.064999,
               0.282346,
               1.075557,
               -1.680968,
               -1.071078,
               -0.247753,
               -0.660887,
               -0.935516,
               0.872213,
               0.11946,
               0.658023,
               -0.816808,
               0.566273,
               2.586032,
               -0.348891,
               1.429143,
               -0.030171,
               2.561505,
               -0.90856,
               -2.40086,
               -0.474217,
               -0.146423,
               -0.226757,
               -2.46842,
               2.472012,
               0.479764,
               -0.450706,
               -0.031404,
               0.078811,
               0.923822,
               -1.628981,
               0.973055,
               1.696735,
               -2.559718,
               0.915031,
               -0.677954,
               -1.790362,
               -0.677371,
               -1.028739,
               3.200351,
               -1.483484,
               0.0,
               3.969412,
               0.0,
               0.012426,
               0.0),
          "test_case_0");

TEST_DATA(LIST(1, 48),
          LIST(16),
          LIST(1, 9, 3, 2),
          16,
          16,
          true,
          LIST(0.421005,
               0.023465,
               -0.394774,
               0.974785,
               0.512418,
               0.219203,
               -0.338684,
               1.122448,
               -0.128486,
               -0.484502,
               0.56865,
               1.332561,
               0.222876,
               0.093504,
               0.89355,
               -0.659941,
               1.187668,
               -2.086986,
               -0.42915,
               -0.198203,
               1.385841,
               0.052231,
               0.587976,
               -0.684267,
               -0.045731,
               0.629634,
               1.78197,
               -1.381788,
               0.812565,
               0.522027,
               0.013688,
               -0.070836,
               1.131118,
               0.147256,
               -0.452005,
               0.263287,
               0.489187,
               -0.710666,
               0.531863,
               -0.996062,
               0.188195,
               -0.022838,
               -0.961315,
               0.174546,
               -2.681746,
               -0.311997,
               -0.007598,
               0.152766),
          LIST(0.0,
               0.03806,
               0.146447,
               0.308658,
               0.5,
               0.691342,
               0.853553,
               0.96194,
               1.0,
               0.96194,
               0.853553,
               0.691342,
               0.5,
               0.308658,
               0.146446,
               0.03806),
          LIST(2.500471,
               0.0,
               2.061596,
               0.0,
               -2.69633,
               0.0,
               -0.832353,
               0.394573,
               -1.064999,
               0.282346,
               1.075557,
               -1.680968,
               -1.071078,
               -0.247753,
               -0.660887,
               -0.935516,
               0.872213,
               0.11946,
               0.658023,
               -0.816808,
               0.566273,
               2.586032,
               -0.348891,
               1.429143,
               -0.030171,
               2.561505,
               -0.90856,
               -2.40086,
               -0.474217,
               -0.146423,
               -0.226757,
               -2.46842,
               2.472012,
               0.479764,
               -0.450706,
               -0.031404,
               0.078811,
               0.923822,
               -1.628981,
               0.973055,
               1.696735,
               -2.559718,
               0.915031,
               -0.677954,
               -1.790362,
               -0.677371,
               -1.028739,
               3.200351,
               -1.483484,
               0.0,
               3.969412,
               0.0,
               0.012426,
               0.0),
          "test_case_1");

TEST_DATA(LIST(1, 48),
          LIST(16),
          LIST(1, 9, 2, 2),
          16,
          32,
          true,
          LIST(0.421005,
               0.023465,
               -0.394774,
               0.974785,
               0.512418,
               0.219203,
               -0.338684,
               1.122448,
               -0.128486,
               -0.484502,
               0.56865,
               1.332561,
               0.222876,
               0.093504,
               0.89355,
               -0.659941,
               1.187668,
               -2.086986,
               -0.42915,
               -0.198203,
               1.385841,
               0.052231,
               0.587976,
               -0.684267,
               -0.045731,
               0.629634,
               1.78197,
               -1.381788,
               0.812565,
               0.522027,
               0.013688,
               -0.070836,
               1.131118,
               0.147256,
               -0.452005,
               0.263287,
               0.489187,
               -0.710666,
               0.531863,
               -0.996062,
               0.188195,
               -0.022838,
               -0.961315,
               0.174546,
               -2.681746,
               -0.311997,
               -0.007598,
               0.152766),
          LIST(0.0,
               0.03806,
               0.146447,
               0.308658,
               0.5,
               0.691342,
               0.853553,
               0.96194,
               1.0,
               0.96194,
               0.853553,
               0.691342,
               0.5,
               0.308658,
               0.146446,
               0.03806),
          LIST(2.500471,
               0.0,
               -2.69633,
               0.0,
               -0.832353,
               0.394573,
               1.075557,
               -1.680968,
               -1.071078,
               -0.247753,
               0.872213,
               0.11946,
               0.658023,
               -0.816808,
               -0.348891,
               1.429143,
               -0.030171,
               2.561505,
               -0.474217,
               -0.146423,
               -0.226757,
               -2.46842,
               -0.450706,
               -0.031404,
               0.078811,
               0.923822,
               1.696735,
               -2.559718,
               0.915031,
               -0.677954,
               -1.028739,
               3.200351,
               -1.483484,
               0.0,
               0.012426,
               0.0),
          "test_case_2");

TEST_DATA(LIST(3, 48),
          LIST(16),
          LIST(3, 9, 2, 2),
          16,
          32,
          true,
          LIST(0.421005,
               0.023465,
               -0.394774,
               0.974785,
               0.512418,
               0.219203,
               -0.338684,
               1.122448,
               -0.128486,
               -0.484502,
               0.56865,
               1.332561,
               0.222876,
               0.093504,
               0.89355,
               -0.659941,
               1.187668,
               -2.086986,
               -0.42915,
               -0.198203,
               1.385841,
               0.052231,
               0.587976,
               -0.684267,
               -0.045731,
               0.629634,
               1.78197,
               -1.381788,
               0.812565,
               0.522027,
               0.013688,
               -0.070836,
               1.131118,
               0.147256,
               -0.452005,
               0.263287,
               0.489187,
               -0.710666,
               0.531863,
               -0.996062,
               0.188195,
               -0.022838,
               -0.961315,
               0.174546,
               -2.681746,
               -0.311997,
               -0.007598,
               0.152766,
               -0.700153,
               0.785022,
               0.449904,
               -0.437027,
               0.846442,
               -2.708081,
               -0.357738,
               1.859077,
               -1.122008,
               0.797016,
               -0.205318,
               0.620443,
               -1.210487,
               -0.100233,
               -0.644188,
               1.252426,
               -1.503346,
               1.685813,
               -0.655548,
               0.148169,
               0.98681,
               -1.806409,
               -0.789457,
               0.934387,
               0.819341,
               -0.359637,
               -0.394646,
               -0.040578,
               1.10817,
               1.745871,
               -0.706232,
               2.154361,
               -0.417549,
               0.724758,
               -1.090765,
               0.9193,
               0.535271,
               -0.979016,
               0.870831,
               -0.405604,
               -0.192899,
               0.242223,
               -2.103053,
               -0.234349,
               -1.273937,
               -0.334684,
               -1.239732,
               1.185672,
               1.292743,
               0.741054,
               -0.700485,
               -0.252933,
               -0.760226,
               0.68806,
               0.761746,
               0.065581,
               -0.189028,
               0.253604,
               0.17645,
               0.993091,
               0.771911,
               -0.45738,
               -0.123291,
               -0.150833,
               -1.207279,
               -1.033516,
               -0.975503,
               0.626698,
               0.50241,
               -1.377113,
               -0.788385,
               0.043618,
               -0.945737,
               0.093409,
               -0.43187,
               0.748239,
               1.084854,
               1.147015,
               0.171417,
               -0.231462,
               -1.082049,
               0.213656,
               -0.888956,
               0.489294,
               -0.722142,
               0.920915,
               -1.327819,
               -1.384117,
               -1.432893,
               -0.535934,
               0.48227,
               0.220006,
               -0.589304,
               -1.305996,
               -1.089244,
               1.762965),
          LIST(0.0,
               0.03806,
               0.146447,
               0.308658,
               0.5,
               0.691342,
               0.853553,
               0.96194,
               1.0,
               0.96194,
               0.853553,
               0.691342,
               0.5,
               0.308658,
               0.146446,
               0.03806),
          LIST(2.500471,
               0.0,
               -2.69633,
               0.0,
               -0.832353,
               0.394573,
               1.075557,
               -1.680968,
               -1.071078,
               -0.247753,
               0.872213,
               0.11946,
               0.658023,
               -0.816808,
               -0.348891,
               1.429143,
               -0.030171,
               2.561505,
               -0.474217,
               -0.146423,
               -0.226757,
               -2.46842,
               -0.450706,
               -0.031404,
               0.078811,
               0.923822,
               1.696735,
               -2.559718,
               0.915031,
               -0.677954,
               -1.028739,
               3.200351,
               -1.483484,
               0.0,
               0.012426,
               0.0,
               -0.789636,
               0.0,
               -2.698145,
               0.0,
               -0.35829,
               0.7881,
               1.297723,
               -2.351696,
               2.059313,
               -1.108987,
               0.58228,
               1.450589,
               -1.325991,
               -0.840667,
               -1.163221,
               -0.362671,
               -0.79498,
               3.236621,
               0.830829,
               0.296243,
               2.930576,
               -2.854989,
               0.544256,
               1.448767,
               -3.939284,
               -0.528339,
               -0.229411,
               -3.582516,
               3.241738,
               2.887635,
               0.092836,
               3.078159,
               -2.836527,
               0.0,
               -1.212438,
               0.0,
               1.769482,
               0.0,
               -4.335095,
               0.0,
               -1.254114,
               0.665334,
               3.115947,
               0.51333,
               -0.628684,
               0.238478,
               -2.409475,
               -2.158762,
               2.008016,
               -0.98037,
               2.824623,
               2.211092,
               -0.863346,
               0.059172,
               -1.077194,
               -0.687371,
               -0.326849,
               1.138742,
               -0.569806,
               0.200439,
               0.238943,
               -0.929741,
               0.855134,
               0.989918,
               0.329058,
               -0.27983,
               0.360809,
               -1.762999,
               -0.775532,
               0.0,
               -1.864981,
               0.0),
          "test_case_3");

TEST_DATA(LIST(3, 48),
          LIST(16),
          LIST(3, 2, 9, 2),
          16,
          32,
          false,
          LIST(0.421005,
               0.023465,
               -0.394774,
               0.974785,
               0.512418,
               0.219203,
               -0.338684,
               1.122448,
               -0.128486,
               -0.484502,
               0.56865,
               1.332561,
               0.222876,
               0.093504,
               0.89355,
               -0.659941,
               1.187668,
               -2.086986,
               -0.42915,
               -0.198203,
               1.385841,
               0.052231,
               0.587976,
               -0.684267,
               -0.045731,
               0.629634,
               1.78197,
               -1.381788,
               0.812565,
               0.522027,
               0.013688,
               -0.070836,
               1.131118,
               0.147256,
               -0.452005,
               0.263287,
               0.489187,
               -0.710666,
               0.531863,
               -0.996062,
               0.188195,
               -0.022838,
               -0.961315,
               0.174546,
               -2.681746,
               -0.311997,
               -0.007598,
               0.152766,
               -0.700153,
               0.785022,
               0.449904,
               -0.437027,
               0.846442,
               -2.708081,
               -0.357738,
               1.859077,
               -1.122008,
               0.797016,
               -0.205318,
               0.620443,
               -1.210487,
               -0.100233,
               -0.644188,
               1.252426,
               -1.503346,
               1.685813,
               -0.655548,
               0.148169,
               0.98681,
               -1.806409,
               -0.789457,
               0.934387,
               0.819341,
               -0.359637,
               -0.394646,
               -0.040578,
               1.10817,
               1.745871,
               -0.706232,
               2.154361,
               -0.417549,
               0.724758,
               -1.090765,
               0.9193,
               0.535271,
               -0.979016,
               0.870831,
               -0.405604,
               -0.192899,
               0.242223,
               -2.103053,
               -0.234349,
               -1.273937,
               -0.334684,
               -1.239732,
               1.185672,
               1.292743,
               0.741054,
               -0.700485,
               -0.252933,
               -0.760226,
               0.68806,
               0.761746,
               0.065581,
               -0.189028,
               0.253604,
               0.17645,
               0.993091,
               0.771911,
               -0.45738,
               -0.123291,
               -0.150833,
               -1.207279,
               -1.033516,
               -0.975503,
               0.626698,
               0.50241,
               -1.377113,
               -0.788385,
               0.043618,
               -0.945737,
               0.093409,
               -0.43187,
               0.748239,
               1.084854,
               1.147015,
               0.171417,
               -0.231462,
               -1.082049,
               0.213656,
               -0.888956,
               0.489294,
               -0.722142,
               0.920915,
               -1.327819,
               -1.384117,
               -1.432893,
               -0.535934,
               0.48227,
               0.220006,
               -0.589304,
               -1.305996,
               -1.089244,
               1.762965),
          LIST(0.0,
               0.03806,
               0.146447,
               0.308658,
               0.5,
               0.691342,
               0.853553,
               0.96194,
               1.0,
               0.96194,
               0.853553,
               0.691342,
               0.5,
               0.308658,
               0.146446,
               0.03806),
          LIST(2.500471,
               0.0,
               -0.832353,
               0.394573,
               -1.071078,
               -0.247753,
               0.658023,
               -0.816808,
               -0.030171,
               2.561505,
               -0.226757,
               -2.46842,
               0.078811,
               0.923822,
               0.915031,
               -0.677954,
               -1.483484,
               0.0,
               -2.69633,
               0.0,
               1.075557,
               -1.680968,
               0.872213,
               0.11946,
               -0.348891,
               1.429143,
               -0.474217,
               -0.146423,
               -0.450706,
               -0.031404,
               1.696735,
               -2.559718,
               -1.028739,
               3.200351,
               0.012426,
               0.0,
               -0.789636,
               0.0,
               -0.35829,
               0.7881,
               2.059313,
               -1.108987,
               -1.325991,
               -0.840667,
               -0.79498,
               3.236621,
               2.930576,
               -2.854989,
               -3.939284,
               -0.528339,
               3.241738,
               2.887635,
               -2.836527,
               0.0,
               -2.698145,
               0.0,
               1.297723,
               -2.351696,
               0.58228,
               1.450589,
               -1.163221,
               -0.362671,
               0.830829,
               0.296243,
               0.544256,
               1.448767,
               -0.229411,
               -3.582516,
               0.092836,
               3.078159,
               -1.212438,
               0.0,
               1.769482,
               0.0,
               -1.254114,
               0.665334,
               -0.628684,
               0.238478,
               2.008016,
               -0.98037,
               -0.863346,
               0.059172,
               -0.326849,
               1.138742,
               0.238943,
               -0.929741,
               0.329058,
               -0.27983,
               -0.775532,
               0.0,
               -4.335095,
               0.0,
               3.115947,
               0.51333,
               -2.409475,
               -2.158762,
               2.824623,
               2.211092,
               -1.077194,
               -0.687371,
               -0.569806,
               0.200439,
               0.855134,
               0.989918,
               0.360809,
               -1.762999,
               -1.864981,
               0.0),
          "test_case_4");

TEST_DATA(LIST(1, 48),
          LIST(33),
          LIST(1, 2, 17, 2),
          33,
          11,
          false,
          LIST(0.421005,
               0.023465,
               -0.394774,
               0.974785,
               0.512418,
               0.219203,
               -0.338684,
               1.122448,
               -0.128486,
               -0.484502,
               0.56865,
               1.332561,
               0.222876,
               0.093504,
               0.89355,
               -0.659941,
               1.187668,
               -2.086986,
               -0.42915,
               -0.198203,
               1.385841,
               0.052231,
               0.587976,
               -0.684267,
               -0.045731,
               0.629634,
               1.78197,
               -1.381788,
               0.812565,
               0.522027,
               0.013688,
               -0.070836,
               1.131118,
               0.147256,
               -0.452005,
               0.263287,
               0.489187,
               -0.710666,
               0.531863,
               -0.996062,
               0.188195,
               -0.022838,
               -0.961315,
               0.174546,
               -2.681746,
               -0.311997,
               -0.007598,
               0.152766),
          LIST(0.0,
               0.009036,
               0.035816,
               0.079373,
               0.138133,
               0.209972,
               0.292293,
               0.382121,
               0.476209,
               0.571157,
               0.663534,
               0.75,
               0.82743,
               0.893027,
               0.944418,
               0.979746,
               0.997736,
               0.997736,
               0.979746,
               0.944418,
               0.893027,
               0.82743,
               0.75,
               0.663534,
               0.571157,
               0.476209,
               0.382121,
               0.292292,
               0.209971,
               0.138133,
               0.079373,
               0.035816,
               0.009036),
          LIST(2.579306,
               0.0,
               -0.152245,
               -0.738268,
               -2.416611,
               1.261868,
               2.867594,
               -1.060565,
               -3.284244,
               0.170454,
               2.868702,
               -0.841069,
               -1.104891,
               3.300689,
               -1.140553,
               -4.425755,
               0.251539,
               2.542669,
               1.792233,
               -0.387007,
               1.135473,
               1.006229,
               -3.639657,
               -1.375989,
               1.341596,
               1.403905,
               -0.208277,
               -2.707592,
               0.588243,
               3.234172,
               1.73603,
               -4.193725,
               -1.924587,
               6.196737,
               3.055838,
               0.0,
               -2.899791,
               0.050701,
               1.185766,
               0.087218,
               0.653565,
               0.058316,
               0.340882,
               -0.196132,
               -0.708827,
               -1.955343,
               -1.790521,
               2.863453,
               2.38143,
               -0.021196,
               -1.090831,
               -2.4223,
               2.221659,
               2.73066,
               -4.076646,
               -3.259353,
               3.247396,
               2.531169,
               -1.041836,
               -0.880713,
               0.399545,
               2.26406,
               -0.611558,
               -1.956384,
               1.462047,
               1.335275,
               -1.2002,
               -5.702536),
          "test_case_5");

TEST_DATA(LIST(48),
          LIST(7),
          LIST(6, 13, 2),
          11,
          3,
          true,
          LIST(-0.41676,
               -0.05627,
               -2.1362,
               1.64027,
               -1.79344,
               -0.84175,
               0.50288,
               -1.24529,
               -1.05795,
               -0.90901,
               0.55145,
               2.29221,
               0.04154,
               -1.11793,
               0.53906,
               -0.59616,
               -0.01913,
               1.175,
               -0.74787,
               0.00903,
               -0.87811,
               -0.15643,
               0.25657,
               -0.98878,
               -0.33882,
               -0.23618,
               -0.63766,
               -1.18761,
               -1.42122,
               -0.1535,
               -0.26906,
               2.23137,
               -2.43477,
               0.11273,
               0.37044,
               1.35963,
               0.50186,
               -0.84421,
               0.00001,
               0.54235,
               -0.31351,
               0.77101,
               -1.86809,
               1.73118,
               1.46768,
               -0.33568,
               0.61134,
               0.04797),
          LIST(0.0, 0.25, 0.75, 1.0, 0.75, 0.25, 0.0),
          LIST(-1.71092,
               0.,
               -2.41009,
               0.,
               2.23022,
               0.,
               -0.7409,
               0.,
               0.45297,
               0.,
               -1.11149,
               0.,
               -1.14862,
               0.,
               -2.14551,
               0.,
               -1.16026,
               0.,
               -0.65135,
               0.,
               1.83099,
               0.,
               -0.1793,
               0.,
               -0.2968,
               0.,
               1.47212,
               0.71877,
               2.17268,
               0.79158,
               -2.28473,
               -0.93586,
               0.4625,
               0.34192,
               -0.56009,
               -0.32899,
               0.93528,
               0.44276,
               1.11077,
               0.05564,
               1.82719,
               -0.1221,
               0.71587,
               1.50743,
               1.10802,
               -0.41842,
               -1.71345,
               -0.67438,
               0.05781,
               0.40969,
               0.4558,
               -0.24137,
               -0.54856,
               -1.56669,
               -1.47087,
               -1.22889,
               2.1535,
               1.84441,
               0.18738,
               -0.28908,
               0.66134,
               0.88008,
               -0.66811,
               -0.52077,
               -1.02705,
               -0.15929,
               -1.12869,
               0.2893,
               0.0583,
               -1.66476,
               -2.16394,
               0.18383,
               1.42389,
               1.02343,
               0.32308,
               -0.7337,
               -0.68826,
               0.55139,
               -0.91886,
               1.85309,
               0.52177,
               0.97814,
               -1.50306,
               -2.29021,
               -0.76526,
               -0.28515,
               -0.47423,
               -1.4385,
               0.63386,
               0.43591,
               0.90989,
               0.38369,
               0.51776,
               -0.36462,
               -0.31809,
               0.57129,
               2.99689,
               0.98808,
               -1.06897,
               -0.98176,
               -0.81284,
               0.72147,
               0.63521,
               -1.1571,
               1.74128,
               -1.03922,
               0.14692,
               -0.1082,
               0.64531,
               1.98433,
               0.856,
               1.12631,
               0.14133,
               1.66429,
               -0.63884,
               -0.57479,
               -0.6772,
               -0.71798,
               -0.19529,
               0.22579,
               0.09013,
               0.66192,
               -2.7275,
               -2.70068,
               0.6808,
               0.74142,
               0.95724,
               -0.28153,
               -0.33733,
               2.09067,
               -0.89051,
               -0.04374,
               -0.16546,
               -0.69762,
               -0.12612,
               -1.43585,
               -0.37017,
               -1.74231,
               0.00518,
               -1.6207,
               0.29356,
               0.84215,
               0.2579,
               0.98549,
               0.05179,
               -0.0244,
               0.03393,
               -1.30044,
               1.1122,
               3.98255,
               -0.23778,
               -0.54982,
               -0.43563,
               -0.19685,
               0.08299,
               -2.86001),
          "test_case_6");